//
//  UIViewController+Extend.m
//  eHSE
//
//  Created by zheng on 16/2/20.
//  Copyright © 2016年 zheng. All rights reserved.
//

#import "UIViewController+Extend.h"
#import <objc/runtime.h>
#import "SlideMenuController.h"
#import "UIButton+YXButton.h"
@implementation UIViewController (Extend)


-(void)setNavigationBarItem {
    [self addLeftBarButtonWithImage:[UIImage imageNamed:@"icon_左侧栏"]];
    //[self addRightBarButtonWithImage:[UIImage imageNamed:@"icon_左侧栏"]];
    [self.slideMenuController removeLeftGestures];
    [self.slideMenuController removeRightGestures];
    [self.slideMenuController addLeftGestures];
    [self.slideMenuController addRightGestures];
}

-(void)removeNavigationBarItem {
    self.navigationItem.leftBarButtonItem = nil;
    self.navigationItem.rightBarButtonItem = nil;
    [self.slideMenuController removeLeftGestures];
    [self.slideMenuController removeRightGestures];
}

- (void)setupNavigationBarWithTitle:(NSString *)title{
    
    
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, [UIFont boldSystemFontOfSize:18], NSFontAttributeName, nil]];
    
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"#17639d"];
    
    self.navigationItem.title = title;
}

@end
